package com.shbt.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TCollege entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_college", catalog = "default_schema")
public class TCollege implements java.io.Serializable {

	// Fields

	private Integer id;
	private TUniversity TUniversity;
	private String collegeCode;
	private String collegeName;
	private Set<TProfessional> TProfessionals = new HashSet<TProfessional>(0);

	// Constructors

	/** default constructor */
	public TCollege() {
	}

	/** minimal constructor */
	public TCollege(Integer id, TUniversity TUniversity) {
		this.id = id;
		this.TUniversity = TUniversity;
	}

	/** full constructor */
	public TCollege(Integer id, TUniversity TUniversity, String collegeCode,
			String collegeName, Set<TProfessional> TProfessionals) {
		this.id = id;
		this.TUniversity = TUniversity;
		this.collegeCode = collegeCode;
		this.collegeName = collegeName;
		this.TProfessionals = TProfessionals;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "t_university_id", nullable = false)
	public TUniversity getTUniversity() {
		return this.TUniversity;
	}

	public void setTUniversity(TUniversity TUniversity) {
		this.TUniversity = TUniversity;
	}

	@Column(name = "college_code", length = 20)
	public String getCollegeCode() {
		return this.collegeCode;
	}

	public void setCollegeCode(String collegeCode) {
		this.collegeCode = collegeCode;
	}

	@Column(name = "college_name", length = 20)
	public String getCollegeName() {
		return this.collegeName;
	}

	public void setCollegeName(String collegeName) {
		this.collegeName = collegeName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TCollege")
	public Set<TProfessional> getTProfessionals() {
		return this.TProfessionals;
	}

	public void setTProfessionals(Set<TProfessional> TProfessionals) {
		this.TProfessionals = TProfessionals;
	}

}